import request from '@/utils/request'

// 创建库区
export function createWarehouseArea(data) {
  return request({
    url: '/wms/warehouse-area/create',
    method: 'post',
    data: data
  })
}

// 更新库区
export function updateWarehouseArea(data) {
  return request({
    url: '/wms/warehouse-area/update',
    method: 'put',
    data: data
  })
}

// 删除库区
export function deleteWarehouseArea(id) {
  return request({
    url: '/wms/warehouse-area/delete?id=' + id,
    method: 'delete'
  })
}

// 获得库区
export function getWarehouseArea(id) {
  return request({
    url: '/wms/warehouse-area/get?id=' + id,
    method: 'get'
  })
}

// 获得库区简单列表
export function getWarehouseAreaSimple(warehouseId) {
  return request({
    url: '/wms/warehouse-area/list-all-simple?warehouseId=' + warehouseId,
    method: 'get'
  })
}

// 获得库区分页
export function getWarehouseAreaPage(query) {
  return request({
    url: '/wms/warehouse-area/page',
    method: 'get',
    params: query
  })
}

// 导出库区 Excel
export function exportWarehouseAreaExcel(query) {
  return request({
    url: '/wms/warehouse-area/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
